<template>
	<view class="page-bg">
		<view>
			<view class="header-bg">
				<!-- <view :style="navbarStyle"> -->
				<view style="height: 44px;">

				</view>
				<view class="f-f-c-c cf f18 fb" style="height: 44px">
					我的
				</view>
				<view class="f-s-b p10" @click="navToView('/pagesA/user-edit/user-edit')">
					<image :src="userInfo.avatarUrl" style="height: 60px; width: 60px;"></image>
					<view class="f1 ml20">
						<view class="cf fb f18">{{userInfo.name}}</view>
						<view class="cf f14 mt10">{{userInfo.phone}}</view>
					</view>
					
					<image src="../../static/mine/inmore.png" style="width: 24px; height: 24px;"></image>
				</view>
			</view>
			<view class="pl10 pr10" style="transform: translateY(-16px);">
				<view class="f-c">
					<view class=" f1 item-bg pl10 pr10" @click="navToView('/pagesA/work-time/work-time')">
						<image src="../../static/mine/time.svg" style="height: 32px; width: 32px;"></image>
						<view class="f1 ml20">
							<view class="c6 f16 fb">时长</view>
							<view class="c3 f22 fb">{{personStatistics.workHours}}</view>
						</view>
					</view>
					<view class="f1 ml20 item-bg pl10 pr10" @click="navToView('/pagesA/order-quantity/order-quantity')">
						<image src="../../static/mine/order-num.svg" style="height: 32px; width: 32px;"></image>
						<view class="f1 ml20">
							<view class="c6 f16 fb">接单记录</view>
							<view class="c3 f22 fb">{{personStatistics.orderNum}}</view>
						</view>
					</view>
				</view>
				<view class="f-c mt20">
					<view class="f1 item-bg pl10 pr10" @click="navToView('/pagesA/day-turnover/day-turnover')">
						<image src="../../static/mine/day-push.svg" style="height: 32px; width: 32px;"></image>
						<view class="f1 ml20">
							<view class="c6 f16 fb">当日流水</view>
							<view class="c3 f22 fb">{{personStatistics.balanceFlowDay}}</view>
						</view>
					</view>
					<view class="f1 item-bg ml20 pl10 pr10"
						@click="navToView('/pagesA/accumulated-turnover/accumulated-turnover')">
						<image src="../../static/mine/all-push.svg" style="height: 32px; width: 32px;"></image>
						<view class="f1 ml20">
							<view class="c6 f16 fb">累计流水</view>
							<view class="c3 f22 fb">{{personStatistics.balanceFlowTotal}}</view>
						</view>
					</view>
				</view>
				<view class="f16 c3 fb mt10 mb10">
					常用工具
				</view>

				<view class="item-bg pt20 pb20">
					<view class="f1 f-f-c-c" @click="navToView('/pagesA/account-statistics/account-statistics')">
						<image src="../../static/mine/account-total.svg" style="width: 46px; height: 46px;"></image>
						<view class="f14 c6">账户统计</view>
					</view>
					<view class="f1 f-f-c-c" @click="navToView('/pagesA/settle-list/settle-list')">
						<image src="../../static/mine/settle-order-img.svg" style="width: 46px; height: 46px;"></image>
						<view class="f14 c6">结算订单</view>
					</view>
					<view class="f1 f-f-c-c" @click="navToView('/pagesA/user-edit/user-edit')">
						<image src="../../static/mine/set-mine.svg" style="width: 46px; height: 46px;"></image>
						<view class="f14 c6">设置</view>
					</view>
					<!-- #ifdef APP -->
					<view class="f1 f-f-c-c" @click="navToView('/pagesA/router/bluetooth')">
						<image src="../../static/mine/bluetooth-mine.svg" style="width: 46px; height: 46px;"></image>
						<view class="f14 c6">蓝牙</view>
					</view>
					<!-- #endif -->
					<!-- #ifdef MP -->
					<view class="f1 f-f-c-c" @click="navToView('/pagesA/wxrouter/bluetooth')">
						<image src="../../static/mine/bluetooth-mine.svg" style="width: 46px; height: 46px;"></image>
						<view class="f14 c6">蓝牙</view>
					</view>
					<!-- #endif -->
					
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		onLoad
	} from '../../uni_modules/uview-ui/libs/mixin/mixin'
	export default {
		data() {
			return {
				personStatistics: {},
				navbarStyle: {
					width: '100%',
					height: '0px',
				},
				userInfo:{}
			}
		},
		onLoad() {
			let systemInfo = uni.getSystemInfoSync()
			this.navbarStyle.height = systemInfo.statusBarHeight + 'px'
		},
		onShow() {
			this.requestOrder()
			this.userinfo();
		},
		methods: {
			navToView(url) {
				uni.navigateTo({
					url: url
				})
			},
			requestOrder() {
				let that = this
				that.request("get", "home/riderApp/personStatistics", uni.getStorageSync('token'), that.params).then(
					res => {
						console.log(res)
						if (res.code === 200) {
							that.personStatistics=res.data
						}
					})
			},
			userinfo() {
				let that = this
				that.request("get", "rider/wxLogin/getRiderInfo", uni.getStorageSync('token'), null).then(
					res => {
						console.log(res)
						if (res.code === 200) {
							that.userInfo = res.data
						}
					})
			},
		}
	}
</script>

<style scoped lang="scss">
	.header-bg {
		width: 100%;
		height: 182px;
		background-repeat: round;
		background-image: url('../../static/mine/mine-bg.png');
		display: flex;
		flex-direction: column;
	}

	.item-bg {
		height: 90px;
		background: #FFFFFF;
		box-shadow: 0px 0px 4px 1px rgba(0, 0, 0, 0.1);
		border-radius: 4px 4px 4px 4px;
		opacity: 1;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>